#include "iostream"
#include "ObserverPattern.h"


int main(int argc, char** argv)
{
    using std::cout;
    
    Subject *subj = new Subject();

    Observer *divObs1 = new DivObserver(subj, 4);
    Observer *divObs2 = new DivObserver(subj, 3);
    Observer *modObs3 = new ModObserver(subj, 3);

    cout << "There are 3 observers registered with subject\n";

    subj->setValue(14);

    cout << "Remove observer #2, now there are 2 left\n";
    subj->detach(divObs2);
    
    subj->setValue(15);

    delete subj;
    delete divObs1;
    delete divObs2;
    delete modObs3;

    return (EXIT_SUCCESS);
}

